# 判断是否为质数
def isprime(n):
    if n<2:
        return False
    for i in range(2,n):
        if n%i==0:
            return False
    return True

# 打印N以内质数
def ltn_prime(n):
    l=[]
    for i in range(n+1):
        if isprime(i):
            l.append(i)
    return l



if __name__ == '__main__':
    # 100以内质数
    print(ltn_prime(100))

    #计算小于10的数字平方值
    print(sum([i * i for i in ltn_prime(10)]))

    # 挑战题
    import  requests
    requests.packages.urllib3.disable_warnings()
    url="https://www.rabbitpre.com"
    resp=requests.get(url,verify=False).text
    with open("tmp.html",'w',encoding='utf8') as f:
        f.write(resp)

